import { request } from 'umi';
import { createCRUD } from '@/utils/api';

const route = '/tenant';

const crud = createCRUD<TenantEntity>(route);

export { crud };

export async function getTenant(id: string) {
  return await request<TenantEntity>(`${route}/get_entity?id=${id}`, {
    method: 'GET',
  });
}

export async function getTenantOptions() {
  return await request<OptionEntity[]>(`${route}/get_tenant_options`, {
    method: 'GET',
  });
}
